<?php
/**
 * Special price list admin filter
 *
 * @author Lukas Normantas
 */
class Default_Model_UserAdminFilter extends Areal_Model_CollectionFilter
{
    public function filterQuery(Doctrine_Query $query)
    {
        $query->orderBy($this->getSort() );
        return $query;
    }

    public function getDefaultSort()
    {
        return 'u.created_at';
    }

    public function getDefaultData()
    {
        return array( );
    }

    public function getAdminPaginator($currentPage)
    {
        $resultsPerPage = 10;
        $q = Doctrine_Query::create()
                ->from( 'Default_Model_User u' );
        $this->filterQuery($q);
        $doctrinePager = new Doctrine_Pager( $q, $currentPage, $resultsPerPage );
        $zendPaginator = Areal_Paginator::build($doctrinePager);
        return $zendPaginator;
    }
}